package com.zmc.admin.infrastructure.service.impl;

import com.zmc.common.utils.PageUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zmc.common.utils.Query;

import com.zmc.admin.infrastructure.dao.SysUserPostDao;
import com.zmc.admin.infrastructure.entity.SysUserPostEntity;
import com.zmc.admin.infrastructure.service.SysUserPostService;


@Service("sysUserPostService")
public class SysUserPostServiceImpl extends ServiceImpl<SysUserPostDao, SysUserPostEntity> implements SysUserPostService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SysUserPostEntity> page = this.page(
                new Query<SysUserPostEntity>().getPage(params),
                new QueryWrapper<SysUserPostEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public void insertBatch(List<SysUserPostEntity> userPostList) {
        baseMapper.insertBatch(userPostList);
    }

    @Override
    public void deleteUserPostByUserId(Long userId) {
        baseMapper.deleteUserPostByUserId(userId);
    }

}